package regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * RegexTest
 *
 * @author nanxin.chen
 * @date 2015/9/28
 */
public class RegexTest {
    public static void main(String[] args) {
        Pattern p = Pattern.compile("[\\^&#<>\"]");
        Matcher matcher = p.matcher("^1&2#3<4>5\"6");
        String result = matcher.replaceAll("");
        System.out.println(result);

        p = Pattern.compile("^\\[.*\\]$");
        matcher = p.matcher("no [] ");
        System.out.println(matcher.find());
        matcher = p.matcher("[no]");
        System.out.println(matcher.find());
    }
}
